<?php
/**
 * Created by JetBrains PhpStorm.
 * User: C
 * Date: 2.12.12
 * Time: 13:50
 * To change this template use File | Settings | File Templates.
 */

class Package extends AppModel {
    //Kuna tabeli nimi pole sama mis controlleri nimi, siis määrame selle käsitsi
    public $useTable = "saadetis";
    public $belongsTo = array(
        'Reciever' => array(
            'className' => 'Person',
            'foreignKey' => 'SaajaIsikukood'
        ),
        'Sender' => array(
            'className' => 'Person',
            'foreignKey' => 'SaatjaIsikukood'
        )
    );
    public $validate = array(
        'PakiNr' => array(
            'rule' => 'notEmpty',
            'message' => 'Saadetise number puudu'
        ),
        'Kaal' => array(
            'rule' => 'notEmpty',
            'message' => 'Kaal puudu'
        ),


    );

}